// 定义接口基础返回字段
export interface ResponseBaseData {
  code: number
  ok: boolean
  message: string
}

// 定义查询中的records数据
export interface spuData {
  category3Id: number | string
  id?: number | string
  spuName: string
  tmId?: number | string
  description: string
  spuImageList: null | imageResponseData[]
  spuSaleAttrList: null | spuAttrResponseData[]
  spuPosterList?: any
}
export type spuRecords = spuData[]
// 导出接口形式
export interface currentSpuResponseData extends ResponseBaseData {
  data: {
    records: spuRecords
    current: number
    pages: number
    size: number
    total: number
    searchCount?: boolean
    hitCount?: boolean
  }
}

// 定义所有品牌data中的数据
export interface tradeMarkResponseData {
  createTime: string
  id: string
  tmName: string
  updateTime: string
}
export interface trademarkResponse extends ResponseBaseData {
  data: tradeMarkResponseData[]
}

// 定义所有image中data数据
export interface imageResponseData {
  id?: number
  imgName?: string
  imgUrl?: string
  spuId?: number
  createTime?: string
  updateTime?: string
  name?: string
  url?: string
}
export interface AllImageResponse extends ResponseBaseData {
  data: imageResponseData[]
}

// 定义spu下某个销售属性中的销售属性值

export interface spuSaleAttrValue {
  id?: number
  spuId?: number
  baseSaleAttrId?: number | string
  saleAttrValueName: string
}
export type spuSaleAttrValueList = spuSaleAttrValue[]
// 定义SPU下所有销售属性
export interface spuAttrResponseData {
  id?: number | string
  spuId?: number | string
  baseSaleAttrId: number | string
  saleAttrName: string
  spuSaleAttrValueList: spuSaleAttrValueList
  flag?: boolean
  addAttrValue?: string
}

export interface SpuSaleAttrResponse extends ResponseBaseData {
  data: spuAttrResponseData[]
}

// 所有销售属性的data
export interface allAttrData {
  createTime: string
  id?: number
  name: string
  updateTime: string
}
// 所有销售属性返回的接口类型
export interface allAttrResponse extends ResponseBaseData {
  data: allAttrData[]
}

export interface Attr {
  attrId: number | string //平台属性的ID
  valueId: number | string //属性值的ID
}

export interface saleArr {
  saleAttrId: number | string //属性ID
  saleAttrValueId: number | string //属性值的ID
}
// 添加sku中的data数据
export interface SkuData {
  category3Id: string | number //三级分类的ID
  spuId: string | number //已有的SPU的ID
  tmId: string | number //SPU品牌的ID
  skuName: string //sku名字
  price: string | number //sku价格
  weight: string | number //sku重量
  skuDesc: string //sku的描述
  skuAttrValueList?: Attr[]
  skuSaleAttrValueList?: saleArr[]
  skuDefaultImg: string //sku图片地址
}

export interface skuInfoResponse extends ResponseBaseData {
  data: SkuData[]
}
